Motion vector coding method and motion vector decoding method

ABSTRACT

A motion vector coding unit executes processing including a neighboring block specification step of specifying a neighboring block which is located in the neighborhood of a current block; a judgment step of judging whether or not the neighboring block has been coded using a motion vector of another block; a prediction step of deriving a predictive motion vector of the current block using a motion vector calculated from the motion vector of the other block as a motion vector of the neighboring block; and a coding step of coding the motion vector of the current block using the predictive motion vector.

BACKGROUND OF THE INVENTION

1. Technical Field

The present invention relates to a motion vector coding method and amotion vector decoding method using inter picture prediction coding.

2. Background Art

In the age of multimedia which integrally handles audio, video and otherinformation, existing information media, i.e., newspapers, magazines,televisions, radios, telephones and other means through whichinformation is conveyed to people, have recently come to be included inthe scope of multimedia. Generally, multimedia refers to something thatis represented by associating not only characters, but also graphics,voices, and especially pictures and the like together, but in order toinclude the aforementioned existing information media in the scope ofmultimedia, it appears as a prerequisite to represent such informationin digital form.

However, when calculating the amount of information contained in each ofthe aforementioned information media as the amount of digitalinformation, while the amount of information per character is 1˜2 bytes,the amount of information to be required for voice is 64 Kbits or overper second (telephone quality), and 100 Mbits or over per second formoving pictures (current television reception quality), and it is notrealistic for the aforementioned information media to handle such anenormous amount of information as it is in digital form. For example,although video phones are already in actual use via Integrated ServicesDigital Network (ISDN) which offers a transmission speed of 64Kbps/s˜1.5 Mbps/s, it is not practical to transmit video shot bytelevision cameras directly through ISDN.

Against this backdrop, information compression techniques have becomerequired, and moving picture compression techniques compliant with H.261and H.263 standards internationally standardized by ITU-T (InternationalTelecommunication Union—Telecommunication Standardization Sector) areemployed for video phones, for example (See, for example, Informationtechnology—Coding of audio-visual objects—Part 2: video (ISO/IEC14496-2), pp. 146-148, 1999 Dec. 1). Moreover, according to informationcompression techniques compliant with the MPEG-1 standard, it ispossible to store picture information in an ordinary music CD (compactdisc) together with sound information.

Here, MPEG (Moving Picture Experts Group) is an international standardon compression of moving picture signals, and MPEG-1 is a standard forcompressing television signal information approximately into onehundredth so that moving picture signals can be transmitted at a rate of1.5 Mbps. Furthermore, since transmission speed within the scope of theMPEG-1 standard is limited primarily to about 1.5 Mbps, MPEG-2, whichwas standardized with a view to satisfy requirements for furtherimproved picture quality, allows data transmission of moving picturesignals at a rate of 2-15 Mbps. Furthermore, MPEG-4 which achieves ahigher compression ratio than that of MPEG-1 and MPEG-2, allows coding,decoding and operation in an object unit, and realizes a new functionrequired for the multimedia age, has been standardized by the workinggroup (ISO/IEC JTC1/SC29/WG11) which has been engaged in thestandardization of MPEG-1 and MPEG-2. MPEG-4 was initially aimed atstandardization of a coding method for a low bit rate, but now it isextended to standardization of a more versatile coding method for movingpictures further including interlace images and higher bit rates.

In the above-mentioned moving picture coding, the amount of informationis compressed by exploiting redundancies in the spatial and temporaldirections. Here, inter picture prediction coding is used as a method ofusing the temporal redundancies. In the inter picture prediction coding,a picture is coded using a temporarily forward or backward picture as areference picture. The motion (a motion vector) of the current pictureto be coded from the reference picture is estimated, and the differencebetween the picture obtained by the motion compensation and the currentpicture is calculated. Then, the spatial redundancies are eliminatedfrom this difference, so as to compress the information amount of themoving picture.

In a moving picture coding method in compliance with MPEG-1, MPEG-2,MPEG-4, H.263, H.26L or the like, a picture which is not inter pictureprediction coded, namely, which is intra picture coded, is called anI-picture. Here, a picture means a single coding unit including both aframe and a field. Also, a picture which is inter picture predictioncoded with reference to one picture is called a P-picture, and a picturewhich is inter picture prediction coded with reference to two previouslyprocessed pictures is called a B-picture.

FIG. 1 is a diagram showing a predictive relation between pictures inthe above-mentioned moving picture coding method.

In FIG. 1, a vertical line indicates one picture, with a picture type(I, P or B) indicated at the lower right thereof. Also, FIG. 1 indicatesthat a picture pointed by an arrow is inter picture prediction codedusing a picture located at the other end of the arrowhead as a referencepicture. For example, a B-picture which is the second from the left iscoded using the first I-picture and the fourth P-picture as referencepictures.

In the moving picture coding method in compliance with MPEG-4, H.26L orthe like, a coding mode called direct mode can be selected for coding aB-picture.

An inter picture prediction coding method in direct mode will beexplained with reference to FIG. 2.

FIG. 2 is an illustration for explaining the inter picture predictioncoding method in direct mode.

It is now assumed that a block C in a picture B3 is coded in directmode. In this case, a motion vector MVp of a block X in a referencepicture (a picture P4 that is a backward reference picture, in thiscase) which has been coded immediately before the picture B3 isexploited, where the block X is co-located with the block C. The motionvector MVp is a motion vector which was used when the block X was coded,and refers to a picture P1. The block C is bi-directionally predictedfrom the reference pictures, namely, the picture P1 and the picture P4,using motion vectors parallel to the motion vector MVp. The motionvectors used for coding the block C are, in this case, a motion vectorMVFc for the picture P1 and a motion vector MVBc for the picture P4.

In the moving picture coding method in compliance with MPEG-4, H.26L orthe like, a difference between a predictive value obtained from motionvectors of neighboring blocks and a motion vector of a current block tobe coded is coded for coding the motion vector. In the followingdescription, a “predictive value” indicates a predictive value of amotion vector. Since motion vectors of neighboring blocks have similardirection and motion in many cases, the amount of coding the motionvector can be reduced by coding the difference from the predictive valueobtained from the motion vectors of the neighboring blocks.

Here, a motion vector coding method in MPEG-4 will be explained withreference to FIGS. 3A-3D.

FIGS. 3A-D are illustrations for explaining a method for coding a motionvector MV of a current block A to be coded in MPEG-4.

In FIGS. 3A˜3D, blocks indicated by a thick line are macroblocks of16×16 pixels, and there exist 4 blocks of 8×8 pixels in each macroblock.Here, it is assumed that a motion vector is obtained at a level of ablock of 8×8 pixels.

As shown in FIG. 3A, as for a current block A located at the upper leftin a macroblock, a difference between a predictive value and a motionvector MV of the current block A is coded, where the predictive value iscalculated from a motion vector MVb of a neighboring block B to the leftof the current block A, a motion vector MVc of a neighboring block Cjust above the current block A and a motion vector MVd of a neighboringblock D above and to the right of the current block A.

Similarly, as shown in FIG. 3B, as for a current block A located at theupper right in a macroblock, a difference between a predictive value anda motion vector MV of the current block A is coded, where the predictivevalue is calculated from a motion vector MVb of a neighboring block B tothe left of the current block A, a motion vector MVc of a neighboringblock C just above the current block A and a motion vector MVd of aneighboring block D above and to the right of the current block A.

As shown in FIG. 3C, as for a current block A located at the lower leftin a macroblock, a difference between a predictive value and a motionvector MV of the current block A is coded, where the predictive value iscalculated from a motion vector MVb of a neighboring block B to the leftof the current block A, a motion vector MVc of a neighboring block Cjust above the current block A and a motion vector MVd of a neighboringblock D above and to the right of the current block A.

As shown in FIG. 3D, as for a current block A located at the lower rightin a macroblock, a difference between a predictive value and a motionvector MV of the current block A is coded, where the predictive value iscalculated from a motion vector MVb of a neighboring block B to the leftof the current block A, a motion vector MVc of a neighboring block Cabove and to the left of the current block A and a motion vector MVd ofa neighboring block D just above the current block A. Here, thepredictive value is calculated using the medians obtained from thehorizontal and vertical components of these three motion vectors MVb,MVc and MVd respectively.

Next, a motion vector coding method in H.26L which has been developedfor standardization will be explained with reference to FIG. 4.

FIG. 4 is an illustration for explaining a method for coding a motionvector MV of a current block A in H.26L.

A current block A is a block of 4×4 pixels, 8×8 pixels or 16×16 pixels,and a motion vector of this current block A is coded using a motionvector of a neighboring block B including a pixel b located to the leftof the current block A, a motion vector of a neighboring block Cincluding a pixel c located just above the current block A and a motionvector of a neighboring block D including a pixel d located above and tothe right of the current block A. Note that the sizes of the neighboringblocks B, C and D are not limited to those as shown in FIG. 4 by dottedlines.

FIG. 5 is a flowchart showing the procedure of coding the motion vectorMV of the current block A using the motion vectors of the neighboringblocks as mentioned above.

First, the neighboring block which refers to the picture that thecurrent block A refers to is specified out of the neighboring blocks B,C and D (Step S502), and the number of specified neighboring blocks isdetermined (Step S504).

When the number of the neighboring blocks determined in Step S504 is 1,the motion vector of that neighboring block which refers to the samepicture is considered to be a predictive value of the motion vector MVof the current block A (Step S506).

When the number of the neighboring blocks determined in Step S505 isanother value other than 1, the motion vector of the neighboring blockwhich refers to another picture other than the picture that the currentblock A refers to, out of the neighboring blocks B, C and D, isconsidered to be 0 (Step S507). And the median of the motion vectors ofthe neighboring blocks B, C and D is considered to be a predictive valueof the motion vector of the current block A (Step S508).

Using the predictive value derived in Step S506 or Step S508 in thismanner, the difference between the predictive value and the motionvector MV of the current block A is calculated and the difference iscoded (Step S510).

As described above, in the motion vector coding methods in compliancewith MPEG-4 and H.26L, motion vectors of neighboring blocks areexploited when coding a motion vector of a current block to be coded.

However, there are cases where motion vectors of neighboring blocks arenot coded. For example, they are cases where a neighboring block isintra picture coded, a B-picture is coded in direct mode, and aP-picture is coded in skip mode. In these cases, the neighboring blocksare coded using the motion vectors of other blocks except when they areintra picture coded, namely, the neighboring blocks are coded usingtheir own motion vectors based on the result of motion estimation.

So, according to the above-mentioned traditional motion vector codingmethod, a motion vector of a current block is coded as follows: Whenthere exists one neighboring block, out of three neighboring blocks,which has no motion vector based on the above result of motionestimation and has been coded using motion vectors of other blocks, themotion vector of that neighboring block is considered to be 0. Whenthere exist two such neighboring blocks, the motion vector of theremaining one neighboring block is used as a predictive value. And whenthere exist three neighboring blocks, the motion vector is codedconsidering a predictive value to be 0.

However, in direct mode or skip mode, motion compensation is actuallyperformed as is the case where a motion vector of a neighboring blockitself is used based on the estimation result, although the motionvector information is not coded. As a result, in the above traditionalmethod, if a neighboring block is coded in direct mode or skip mode, themotion vector of the neighboring block is not used as a candidate for apredictive value. So, there is a problem of causing an inaccuratepredictive value of a motion vector when coding the motion vector, andthus causing lower coding efficiency.

The present invention is conceived to solve this problem, and the objectthereof is to provide a motion vector coding method and a motion vectordecoding method for obtaining a more accurate predictive value forhigher coding efficiency.

SUMMARY OF INVENTION

In order to achieve the above object, the motion vector coding methodaccording to the present invention is a motion vector coding method forcoding a motion vector of a current block in a moving picture,comprising: a neighboring block specification step of specifying aneighboring block which is located in the neighborhood of the currentblock and has already been coded; a judgment step of judging whether ornot the neighboring block has been coded using a motion vector ofanother block; a prediction step of deriving a predictive motion vectorof the current block using a motion vector calculated from the motionvector of said another block as a motion vector of the neighboringblock, when it is judged in the judgment step that the neighboring blockhas been coded using the motion vector of said another block; and acoding step of coding the motion vector of the current block using thepredictive motion vector.

As a result, when a motion vector of a current block is coded using apredictive motion vector derived from motion vectors of neighboringblocks, if any of the neighboring blocks has been coded using motionvectors of other blocks, the motion vector of the neighboring block isnot considered to be 0 but to be the motion vector calculated from themotion vectors of the other blocks. Therefore, a more accuratepredictive motion vector can be obtained, and thus efficiency of codingthe motion vector can be improved.

Also, the motion vector decoding method according to the presentinvention is a motion vector decoding method for decoding a coded motionvector of a current block in a moving picture, comprising: a neighboringblock specification step of specifying a neighboring block which islocated in the neighborhood of the current block and has already beendecoded, a judgment step of judging whether or not the neighboring blockhas been coded using a motion vector of another block; a prediction stepof deriving a predictive motion vector of the current block using amotion vector calculated from the motion vector of said another block asa motion vector of the neighboring block, when it is judged in thejudgment step that the neighboring block has been coded using the motionvector of said another block; and a decoding step of decoding the codedmotion vector of the current block using the predictive motion vector.

As a result, the motion vector which has been coded according to themotion vector coding method of the present invention can be properlydecoded, and thus the practical value thereof is high.

Note that the present invention can also be realized as a moving picturecoding apparatus and a program using the above-mentioned motion vectorcoding method, and a storage medium storing the program, and a motionpicture decoding apparatus and a program using the above-mentionedmotion vector decoding method, and a storage medium storing the program.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a diagram showing a predictive relation between pictures in amoving picture coding method.

FIG. 2 is an illustration for explaining the inter picture predictionmethod in direct mode.

FIGS. 3A-3D are illustrations for explaining a method for coding amotion vector of a current block in MPEG-4.

FIG. 4 is an illustration for explaining a method for coding a motionvector of a current block in H.26L.

FIG. 5 is a flowchart showing the coding procedure in H26L.

FIG. 6 is a block diagram showing a structure of a moving picture codingapparatus in a first embodiment of the present invention.

FIGS. 7A and 7B are diagrams showing how the pictures in a frame memoryare inputted and outputted in the first embodiment.

FIG. 8 is a flowchart showing an operation of a motion vector codingunit in the first embodiment.

FIG. 9 is an illustration for explaining how to code a neighboring blockin skip mode in the first embodiment.

FIG. 10 is an illustration for explaining inter picture predictioncoding using bi-directional motion vectors in the first embodiment.

FIG. 11 is an illustration for explaining how to code a neighboringblock in temporal direct mode in the first embodiment.

FIG. 12 is an illustration for explaining how to code a neighboringblock in spatial direct mode in the first embodiment.

FIG. 13 is a flowchart showing another operation of the motion vectorcoding unit in the first embodiment.

FIG. 14 is a block diagram showing a structure of a moving picturedecoding apparatus in a second embodiment of the present invention.

FIG. 15 is a flowchart showing an operation of a motion vector decodingunit in the second embodiment.

FIGS. 16A and 16B are illustrations for explaining how the pictures areinputted to and outputted from the moving picture decoding apparatus inthe second embodiment.

FIG. 17 is a flowchart showing another operation of the motion vectordecoding unit in the second embodiment.

FIGS. 18A-18C are illustrations of a recording medium in a thirdembodiment of the present invention.

FIG. 19 is a block diagram showing an overall configuration of a contentproviding system in a fourth embodiment of the present invention.

FIG. 20 is a front view of a mobile phone in the fourth embodiment.

FIG. 21 is a block diagram of the mobile phone in the fourth embodiment.

FIG. 22 is a block diagram showing an overall configuration of a digitalbroadcasting system in the fourth embodiment.

DETAILED DESCRIPTION OF THE INVENTION First Embodiment

A moving picture coding apparatus in a first embodiment of the presentinvention will be explained with reference to the figures.

FIG. 6 is a block diagram of the moving picture coding apparatus in thefirst embodiment of the present invention.

This moving picture coding apparatus 100 aims at improving codingefficiency by improving accuracy of a predictive value of a motionvector, and includes a frame memory 101, a difference calculation unit102, a prediction error coding unit 103, a bit stream generation unit104, a prediction error decoding unit 105, an addition unit 106, a framememory 107, a motion vector estimation unit 108, a mode selection unit109, a coding control unit 110, switches 111˜115, a motion vectorstorage unit 116 and a motion vector coding unit 117.

The frame memory 101 is a picture memory for holding inputted pictureson a picture-by-picture basis, and reorders the pictures inputted andobtained in order of time into coding order for output. The pictures arereordered under the control of the coding control unit 110.

FIG. 7A shows how the pictures are inputted in the frame memory 101.

In FIG. 7A, vertical lines show pictures, and an alphabet and a numberat the lower right of each picture indicates a picture type (I, P or B)and a picture number in order of time. The pictures inputted to theframe memory 101 are reordered into coding order. The pictures arereordered into coding order based on the reference relations in interpicture prediction coding, that is, the pictures are reordered so thatthe pictures used as reference pictures are coded earlier than thepictures which refer to those reference pictures. For example, thereference relations of the pictures P7˜P13 are shown by arrows in FIG.7A. In FIG. 7A, the arrowheads indicate the pictures which refer toreference pictures, and the other ends of the arrows indicate thereference pictures. In this case, the pictures shown in FIG. 7A arereordered into those as shown in FIG. 7B.

FIG. 7B shows the pictures inputted as shown in FIG. 7A and reordered.The pictures reordered in the frame memory 101 are read out on amacroblock basis. In this case, a macroblock is horizontal 16×vertical16 pixels in size.

The difference calculation unit 102 obtains image data of everymacroblock from the frame memory 101 via the switch 111, and alsoobtains a motion compensation image from the mode selection unit 109.Then, the difference calculation unit 102 calculates the differencebetween the image data and the motion compensation image on a macroblockbasis to generate a prediction error image for output.

The prediction error coding unit 103 performs coding processingincluding frequency transformation like discrete cosine transformationand quantization on the image data obtained from the frame memory 101via the switch 112 and the prediction error image obtained by thedifference calculation unit 102, so as to create coded data. Forexample, the frequency transformation and quantization are performed ina unit of horizontal 8×vertical 8 pixels. Then, the prediction errorcoding unit 103 outputs the coded data to the bit stream generation unit104 and the prediction error decoding unit 105.

The bit stream generation unit 104 performs variable length coding onthe coded data outputted from the prediction error coding unit 103,converts the data into that in a bit stream format for output, andfurther adds information on motion vectors inputted from the motionvector coding unit 117, information on a coding mode inputted from themode selection unit 109, header information and others, so as togenerate a bit stream.

The prediction error decoding unit 105 inversely quantizes the codeddata outputted from the prediction error coding unit 103, and thenperforms inverse frequency transformation such as inverse discretecosine transformation so as to decode it into a prediction error image.

The addition unit 106 adds the motion compensation image to theprediction error image obtained as a result of decoding, and outputs adecoded picture that is image data indicating an image of one picturewhich has been coded and decoded.

The frame memory 107 is a picture memory which holds, on apicture-by-picture basis, pictures used as reference pictures whencoding other pictures, out of the decoded pictures outputted from theaddition unit 106.

The motion vector estimation unit 108 estimates motion vectors of eachblock in a current macroblock to be coded, using the decoded picturesaccumulated in the frame memory 107 as reference pictures. The estimatedmotion vectors are outputted to the mode selection unit 109.

The mode selection unit 109 determines a coding mode of the macroblockusing the motion vectors estimated by the motion vector estimation unit108. Here, the coding mode means a method for coding a macroblock. Forexample, when a current picture is a P-picture, the mode selection unit109 determines a coding mode out of the following: intra picture coding,inter picture prediction coding using motion vectors, and skip mode(inter picture prediction coding in which no motion vector of a currentblock is coded because prediction coding is performed using a motionvector obtained from motion vectors of other blocks, and no coefficientvalue is coded because all the coefficient values are 0 as a result ofthe prediction error coding). Generally, a coding mode is determined soas to minimize a coding error using a predetermined bit amount.

The mode selection unit 109 outputs the determined coding mode to thebit stream generation unit 104, and outputs the motion vectors used forthat coding mode to the motion vector coding unit 117, respectively.When the determined coding mode is inter picture prediction coding usingmotion vectors, the mode selection unit 109 further stores the motionvectors and the coding mode used for that inter picture predictioncoding in the motion vector storage unit 116.

Also, the mode selection unit 109 performs motion compensation based onthe determined coding mode and the motion vectors estimated by themotion vector estimation unit 108 so as to create a motion compensationimage, and outputs the motion compensation image to the differencecalculation unit 102 and the addition unit 106. However, if intrapicture coding is selected, no motion compensation image is outputted.When selecting intra picture coding, the mode selection unit 109 furthercontrols the switch 111 and the switch 112 to connect to a terminal “a”and a terminal “c” respectively, and when selecting inter pictureprediction coding, it controls the switch 111 and the switch 112 toconnect to a terminal “b” and a terminal “d” respectively. Theabove-mentioned motion compensation is performed on a block-by-blockbasis (8×8 pixels in this case).

The coding control unit 110 determines a picture type (I, P or B) usedfor coding an inputted picture, and controls the switches 113, 114 and115 depending on the picture type. Here, a picture type is generallydetermined using a method for allocating a picture type periodically,for example.

The motion vector storage unit 116 obtains the motion vectors used forinter picture prediction coding and the coding mode from the modeselection unit 109, and stores them.

When the mode selection unit 109 selects inter picture prediction codingusing motion vectors, the motion vector coding unit 117 codes a motionvector of a current block by the methods illustrated in FIGS. 3A-3D andFIG. 4. As described above, the motion vector coding unit 117 specifiesthree neighboring blocks of the current block, determines a predictivevalue based on the motion vectors of the neighboring blocks, and codes adifference between the predictive value and the motion vector of thecurrent block to be coded.

When coding a motion vector of a current block, if a neighboring blockis coded using motion vectors of other blocks, such as skip mode anddirect mode, the motion vector coding unit 117 in the present embodimentdoes not consider the motion vector of the neighboring block to be 0 asthe conventional art does, but treats a motion vector obtained from themotion vectors of the other blocks as the motion vector of theneighboring block when coding it.

FIG. 8 is a flowchart showing the general operation of the motion vectorcoding unit 117 in the present embodiment.

First, the motion vector coding unit 117 specifies three previouslycoded neighboring blocks of a current block (Step S100).

The motion vector coding unit 117 judges whether each of the specifiedneighboring blocks is a neighboring block Ba which has been coded usingmotion vectors of other blocks or a neighboring block Bb which has beencoded without using motion vectors of other blocks (Step S102).

As a result, the motion vector coding unit 117 determines whether thespecified three neighboring blocks include a neighboring block Ba or not(Step S104).

When it is judged in Step S104 that the neighboring block Ba is included(Y in Step S104), the motion vector coding unit 117 derives a predictivevalue from the motion vectors of the three neighboring blocks bytreating a motion vector obtained from the motion vectors of the otherblocks as a motion vector of the neighboring block Ba for coding it, asmentioned above (Step S106).

On the other hand, when it is judged in Step S104 that the neighboringblock Ba is not included (N in Step s104), the motion vector coding unit117 derives a predictive value from motion vectors obtained based on themotion estimation from respective three neighboring blocks Bb and themode selection (Step S108).

Then, the motion vector coding unit 117 codes a difference between themotion vector of the current block and the predictive value derived inSteps S106 or S108 (Step S110). The motion vector coding unit 117 alsooutputs the motion vector coded as above to the bit stream generationunit 104.

Here, the above-mentioned coding processing by the moving picture codingapparatus 100 will be explained specifically by taking coding of apicture P13 and a picture B11 as shown in FIGS. 7A and 7B as an example.

(Coding of Picture P13)

Since the picture P13 is a P-picture, the moving picture codingapparatus 100 codes the picture 13 by inter picture prediction codingusing another picture as a reference picture. In this case, thereference picture is a picture P10. This picture P10 has been alreadycoded, and the decoded picture thereof is stored in the frame memory107.

When coding a P-picture, the coding control unit 110 controls theswitches 113, 114 and 115 to be ON. Therefore, macroblocks in thepicture P13 which are read out from the frame memory 101 are obtained bythe motion vector estimation unit 108, the mode selection unit 109 andthe difference calculation unit 102.

The motion vector estimation unit 108 estimates the motion vector ofeach block in the macroblock using the decoded picture of the pictureP10 stored in the frame memory 107 as a reference picture, and outputsthe estimated motion vector to the mode selection unit 109.

The mode selection unit 109 determines a coding mode of the macroblockin the picture P13 using the motion vector estimated by the motionvector estimation unit 108. Since the picture P13 is a P-picture, themode selection unit 109 determines, as mentioned above, a coding modeout of the following: intra picture coding, inter picture predictioncoding using motion vectors, and skip mode (an inter picture predictioncoding in which no motion vector of a current block is coded becauseprediction coding is performed using a motion vector obtained frommotion vectors of other blocks, and no coefficient value is codedbecause all the coefficient values are 0 as a result of the predictionerror coding).

When the mode selection unit 109 selects inter picture prediction codingusing motion vectors, the motion vector coding unit 117 in the presentembodiment codes the motion vector of the current block in the pictureP13 by the method as illustrated in FIGS. 3A-3D. When a neighboringblock of the current block is coded in skip mode, the motion vectorcoding unit 117 does not consider the motion vector of the neighboringblock to be 0, but treats a motion vector obtained from other blocks forcoding the neighboring block as a motion vector of that block.

A method of coding a motion vector of a current block used when aneighboring block is coded in skip mode will be explained.

FIG. 9 is an illustration for explaining how to code a neighboring blockC in skip mode.

As shown in FIG. 9, when a neighboring block C in the picture P13 iscoded in skip mode, a median of a motion vector MVe of a block E, amotion vector MVf of a block F and a motion vector MVg of a block G,which are located in the neighborhood of the neighboring block C, iscalculated, and the neighboring block C is coded using a motion vectorMVcm indicating the median. Here, a median of motion vectors is obtainedby calculating medians of horizontal and vertical components of themotion vectors respectively, for example.

When coding the motion vector of the current block A as shown in FIG. 9,the motion vector coding unit 117 specifies the three neighboring blocksB, C and D of the current block A (as for the locations of the blocks B,C and D, see FIGS. 3A-3D and FIG. 4), and judges whether or not each ofthe neighboring blocks B, C and D is a block which has been coded usingmotion vectors of other blocks. As a result, when it is judged that onlythe neighboring block C is coded in skip mode, that is, coded usingother blocks, the motion vector coding unit 117 treats the median (amotion vector MVcm) calculated from the motion vectors of the otherblocks E, F and G for coding the neighboring block C as a motion vectorof the neighboring block C, as mentioned above, and calculates themedian of the motion vector MVcm and the motion vectors of theneighboring blocks B and D so as to consider it as a predictive value ofthe motion vector of the current block A. Then, the motion vector codingunit 117 codes a difference between the predictive value and the motionvector of the current block A.

The motion vector storage unit 116 stores coding modes of coded blocks.The motion vector coding unit 117 judges whether each of the neighboringblocks B, C and D is a block coded using motion vectors of other blocksor not based on the coding modes stored in the motion vector storageunit 116. The motion vector storage unit 116 further stores motionvectors of blocks which have been coded without using motion vectors ofother blocks but using their own motion vectors estimated from referencepictures. To be more specific, the motion vector storage unit 116 storesthe motion vectors MVe, MVf and MVg of the blocks E, F and G, and themotion vector coding unit 117 calculates the above-mentioned motionvector MVcm of the neighboring block C using these motion vectors storedin the motion vector storage unit 116 when coding the motion vector ofthe current block A. Note that as for a picture which has been codedusing motion vectors of other blocks, a motion vector thereof which isobtained by calculating a median of the motion vectors of the otherblocks may be stored in the motion vector storage unit 116 in advance.In this case, since the motion vector storage unit 116 stores the motionvector MVcm in advance, the motion vector coding unit 117 does not needto calculate the motion vector MVcm of the neighboring block C but canuse the motion vector MVcm stored in the motion vector storage unit 116directly as a motion vector of the neighboring block C, when coding themotion vector of the current block A.

On the other hand, a prediction error image indicating a differencebetween a current macroblock in the picture P13 and a motioncompensation image is coded by the prediction error coding unit 103 andgenerated as coded data, and information on the motion vector coded asmentioned above is added to the coded data by the bit stream generationunit 104. However, a difference between a macroblock which has beencoded in skip mode and a motion compensation image is 0, and informationon the motion vector is not added to the coded data.

The remaining macroblocks in the picture P13 are coded in the samemanner. After completing coding of all the macroblocks in the pictureP13, coding of the picture B11 follows.

(Coding of Picture B11)

Since the picture B11 is a B-picture, the moving picture codingapparatus 100 codes the picture B11 by inter picture prediction codingusing two other pictures as reference pictures. In this case, thereference pictures are the picture P10 located forward of the pictureB11 and the picture P13 located backward of the picture B11. Thesepictures P10 and P13 have been already coded, and the decoded picturesthereof are stored in the frame memory 107.

When coding a B-picture, the coding control unit 110 controls the switch113 to be ON and the switches 114 and 115 to be OFF. Therefore,macroblocks in the picture B11 which are read out from the frame memory101 are obtained by the motion vector estimation unit 108, the modeselection unit 109 and the difference calculation unit 102.

The motion vector estimation unit 108 estimates the forward motionvector and the backward motion vector of each block in a macroblockusing a decoded picture of the picture P10 stored in the frame memory107 as a forward reference picture and a decoded picture of the pictureP13 as a backward reference picture, and outputs the estimated forwardand backward motion vectors to the mode selection unit 109.

The mode selection unit 109 determines a coding mode of the macroblockin the picture B11 using the forward and backward motion vectorsestimated by the motion vector estimation unit 108. Since the pictureB11 is a B-picture, the mode selection unit 109 determines a coding modeout of the following: intra picture coding, inter picture predictioncoding using forward motion vectors, inter picture prediction codingusing backward motion vectors, inter picture prediction coding usingbi-directional motion vectors, and direct mode (inter picture predictioncoding in which motion compensation is performed using a motion vectorobtained from motion vectors of other blocks and no motion vector iscoded), for example.

When the mode selection unit 109 selects inter picture prediction codingusing motion vectors, the motion vector coding unit 117 in the presentembodiment codes the motion vectors of the current block in the pictureB11 by the method as illustrated in FIGS. 3A-3D.

More specifically, when the mode selection unit 109 selects interpicture prediction coding using bi-directional motion vectors, themotion vector coding unit 117 codes the motion vectors of the currentblock in the following manner.

FIG. 10 is an illustration for explaining inter picture predictioncoding using bi-directional motion vectors.

When coding motion vectors of a current block A, the motion vectorcoding unit 117 codes a forward motion vector MVF and a backward motionvector MVB.

To be more specific, the motion vector coding unit 117 considers amedian of forward motion vectors MVF1, MVF2 and MVF3 of the neighboringblocks B, C and D to be a predictive value of the forward motion vectorMVF, and codes a difference between the forward motion vector MVF andthe predictive value thereof. The motion vector coding unit 117 alsoconsiders a median of backward motion vectors MVB1, MVB2 and MVB3 of theneighboring blocks B, C and D to be a predictive value of the backwardmotion vector MVB, and codes a difference between the backward motionvector MVB and the predictive value thereof. Here, the median of themotion vectors is obtained by calculating medians of horizontal andvertical components of the motion vectors respectively, for example.

When coding motion vectors of a current block in a B-picture, if aneighboring block has been coded in direct mode, the motion vectorcoding unit 117 in the present embodiment does not consider the motionvectors of the neighboring block to be 0, but considers motion vectorsobtained from other blocks as motion vectors of the neighboring block.There are two types of direct modes: temporal direct mode and spatialdirect mode.

First, how to code motion vectors of a current block when a neighboringblock is coded in temporal direct mode will be explained.

FIG. 11 is an illustration for explaining how to code the neighboringblock in temporal direct mode.

As shown in FIG. 11, when the neighboring block C in the picture B11 iscoded in direct mode, a motion vector MVp of a block X, which isco-located with the neighboring block C, in the picture P13 that is ajust previously coded backward reference picture, is used. The motionvector MVp is a motion vector used for coding the block X, and is storedin the motion vector storage unit 116. This motion vector MVp refers tothe picture P10. The neighboring block C is coded by bi-directionalprediction from the reference pictures, the picture P10 and the pictureP13, using motion vectors parallel to the motion vector MVp. In thiscase, the motion vectors used for coding the neighboring block C are amotion vector MVFc for the picture P10 and a motion vector MVBc for thepicture P13.

In this case where the forward motion vector MVFc is mvf, the backwardmotion vector MVBc is mvb, the motion vector MVp is mvp, the temporaldistance between the backward reference picture (picture P13) for thecurrent picture (picture B11) and the reference picture (picture P10)pointed by the block in the backward reference picture is TRD, and thetemporal distance between the current picture (picture B11) and thereference picture (picture P10) pointed by the block in the backwardreference picture is TRB, mvf and mvb are respectively calculated byEquation 1 and Equation 2.

mvf=mvp×TRB/TRD  Equation 1

mvb=(TRB−TRD)×xmvp/TRD  Equation 2

where mvf and mvb respectively represent horizontal components andvertical components of the motion vectors. And the plus values indicatethe direction of the motion vector MVp, and the minus values indicatethe direction opposite to that of the motion vector MVp.

The neighboring block C is coded using the motion vectors MVFc and MVBcobtained as mentioned above.

When coding the motion vectors MVF and MVB of the current block A asshown in FIG. 10, the motion vector coding unit 117 specifies the threeneighboring blocks B, C and D of the current block A, and judges whetheror not each of the neighboring blocks B, C and D is a block which hasbeen coded using a motion vector of another block. As a result, when itis judged that only the neighboring block C is coded in temporal directmode, that is, coded using the motion vector of the other block, themotion vector coding unit 117 treats the motion vectors MVFc and MVBccalculated from the motion vector MVp of the block X that is the otherblock for coding the neighboring block C as motion vectors of theneighboring block C, and calculates the medians of the motion vectorsMVFc and MVBc and the motion vectors of the neighboring blocks B and Dso as to derive predictive values of the motion vectors of the currentblock A. A forward predictive value and a backward predictive value arederived separately. Then, the motion vector coding unit 117 codesdifferences between the predictive values and the motion vectors MVF andMVB of the current block A, respectively.

The motion vector storage unit 116 stores coding modes of coded blocks,and based on the coding modes stored in this motion vector storage unit116, the motion vector coding unit 117 judges whether or not each of theneighboring blocks B, C and D has been coded using motion vectors ofother blocks. The motion vector storage unit 116 further stores motionvectors of blocks which have been coded without using motion vectors ofother blocks but using their own motion vectors estimated from referencepictures. In other words, when coding the motion vectors of the currentblock A, the motion vector coding unit 117 uses the motion vectorsstored in the motion vector storage unit 116 as they are for theneighboring blocks B and D, but for the neighboring block C, it readsout the motion vector MVp of the block X stored in the motion vectorstorage unit 116 to calculate the motion vectors MVFc and MVBc. Notethat the motion vector storage unit 116 may store in advance motionvectors calculated from motion vectors of other blocks in order to codea block which has been coded using the motion vectors of the otherblocks. In this case, the motion vector storage unit 116 stores inadvance the motion vectors MVFc and MVBc. Therefore, when coding themotion vectors of the current block A, the motion vector coding unit 117does not need to read out the motion vector MVp of the block X so as tocalculate the motion vectors MVFc and MVBc of the neighboring block Cusing Equation 1 and Equation 2, but can use the motion vectors MVFc andMVBc stored in the motion vector storage unit 116 directly as the motionvectors of the neighboring block C.

Next, a method for coding motion vectors of a current block in a casewhere a neighboring block is coded in spatial direct mode will beexplained.

FIG. 12 is an illustration for explaining how to code a neighboringblock in spatial direct mode.

As shown in FIG. 12, when a neighboring block C of the picture B11 iscoded in spatial direct mode, it is coded using motion vectors MVFc andMVBc calculated based on medians in the forward and backward directionsrespectively which are obtained from the motion vectors MVFe and MVBe ofthe block E, the motion vectors MVFf and MVBf of the block F and themotion vectors MVFg and MVBg of the block G, where the blocks E, F and Gare located in the neighborhood of the neighboring block C.

When coding the motion vectors MVF and MVB of the current block A asshown in FIG. 10, the motion vector coding unit 117 specifies the threeneighboring blocks B, C and D in the neighborhood of the current blockA, and judges whether each of the neighboring blocks B, C and D is ablock which has been coded using motion vectors of other blocks or not.As a result, when the motion vector coding unit 117 judges that only theneighboring block C has been coded in spatial direct mode, that is,using motion vectors of other blocks, it treats the motion vectors MVFcand MVBc calculated from the blocks E, F and G which are the otherblocks used for coding the neighboring block C as the motion vectors ofthe neighboring block C, calculates the medians of the motion vectorsMVFc and MVBc and the motion vectors of the neighboring blocks B and D,and thus derives predictive values of the motion vectors of the currentblock A, as shown in FIG. 12. Then, the motion vector coding unit 117codes differences between the predictive values and the motion vectorsMVF and MVB of the current block A.

The motion vector storage unit 116 stores motion vectors of blocks whichhave been coded without using motion vectors of other blocks but usingtheir own motion vectors estimated from reference pictures. In otherwords, it stores two motion vectors in the forward and backwarddirections for each of the blocks E, F and G. When coding the motionvectors of the current block A, the motion vector coding unit 117calculates the motion vectors MVFc and MVBc of the neighboring block Cusing these motion vectors stored in the motion vector storage unit 116.Note that the motion vector storage unit 116 may store in advance twomotion vectors in the forward and backward directions which arecalculated based on medians obtained from motion vectors of other blocksin order to code a block which has been coded using the motion vectorsof the other blocks. In this case, the motion vector storage unit 116stores in advance the motion vectors MVFc and MVBc. Therefore, whencoding the motion vectors of the current block A, the motion vectorcoding unit 117 does not need to calculate the motion vectors MVFc andMVBc of the neighboring block C, but can use the motion vectors MVFc andMVBc stored in the motion vector storage unit 116 directly as the motionvectors of the neighboring block C.

As described above, when the neighboring block C is coded in the abovetemporal direct mode, the motion vectors of the backward referencepicture (the picture P13 in the above case) of the current picture needsto be stored in the motion vector storage unit 116, but when theneighboring block C is coded in spatial direct mode, the storage thereofcan be omitted.

Here, when coding motion vectors of a current block, the moving picturecoding apparatus 100 performs an exceptional processing if a neighboringblock of the current block is not inter picture prediction coded, asmentioned above, but intra picture coded.

For example, when there exists one block which has been intra picturecoded in the three neighboring blocks, the motion vector coding unit 117of the moving picture coding apparatus 100 performs processingconsidering the motion vectors of the block to be 0. When there existtwo neighboring blocks which have been intra picture coded, the motionvector coding unit 117 uses the motion vectors of the remaining oneneighboring block as predictive values of motion vectors of a currentblock. Further, when all of the three neighboring blocks have been intrapicture coded, the motion vector coding unit 117 performs codingprocessing of the motion vectors of the current block considering thepredictive values thereof to be 0.

On the other hand, the prediction error image indicating a differencebetween a current macroblock in the picture B11 and the motioncompensation image has been coded by the prediction error coding unit103 and generated as coded data, and information on the motion vectorswhich have been coded as mentioned above is added to the coded data bythe bit stream generation unit 104. However, information on motionvectors of a macroblock which has been coded in direct mode is not addedto the coded data.

Coding processing of the remaining macroblocks in the picture B11 isperformed in the same manner. After the processing is completed for allthe macroblocks in the picture B11, the coding processing of the pictureB12 follows.

As described above, according to the motion vector coding method of thepresent invention, a motion vector of each current block is coded usinga predictive value derived from motion vectors of the previously codedneighboring blocks and the motion vector of the current block. If any ofthe neighboring blocks has been coded using a motion vector calculatedfrom motion vectors of other blocks, for example, in skip mode or directmode, a predictive value is derived using, as a motion vector of theneighboring block, the motion vector calculated from the motion vectorsof the other blocks for coding that neighboring block.

Accordingly, when a motion vector of a current block is coded using apredictive value derived from a motion vector of a neighboring block, ifthe neighboring block is coded using motion vectors of other blocks, themotion vector of the neighboring block is not considered as 0 like theconventional art, but the motion vector calculated from the motionvectors of the other blocks is used as the motion vector of theneighboring block. As a result, accuracy of the above predictive valueis improved, and thus efficiency of coding motion vectors can beimproved.

Note that in the present embodiment, a case has been explained where amacroblock is coded in every horizontal 16×vertical 16 pixels, motioncompensation is performed in every block of horizontal 8×vertical 8pixels, and a block prediction error image is coded in every horizontal8×vertical 8 pixels, but this processing may be performed in other unitsof pixels.

Also, in the present embodiment, a case has been explained where amedian calculated from motion vectors of previously coded threeneighboring blocks is used as a predictive value for coding a motionvector, but any other number of neighboring blocks other than three maybe applied, and the predictive value may be determined by any othermethod. For example, a motion vector of an immediately left block may beused as a predictive value, or an average, instead of a median, may beused.

Also, in the present embodiment, locations of neighboring blocks forcoding a motion vector has been explained using FIGS. 3A-3D and FIG. 4,but any other locations may be applied.

Also, in the present embodiment, a method for coding a current blockusing motion vectors of other blocks has been explained by taking skipmode and temporal and spatial direct modes as examples, but any othermethod may be used.

Also, in the present embodiment, a case has been explained where adifference between a motion vector of a current block and a predictivevalue obtained from motion vectors of neighboring blocks so as to codethe motion vector, but any other method other than obtaining of adifference may be used to code the motion vector.

Also, in the present embodiment, a case has been explained where when aneighboring block is coded in spatial direct mode, a median of motionvectors of previously coded three blocks in the neighborhood of theneighboring block is calculated and is treated as a motion vector of theneighboring block, but any other number of blocks other than three maybe used, and any other method may be used to determine the motionvector. For example, a motion vector of an immediately left block may beused as a motion vector of a neighboring block, or an average, insteadof a median, may be used.

Also, in the present embodiment, when a block in a B-picture is coded inspatial direct mode, two motion vectors of the block in the forward andbackward directions are calculated, but two motion vectors in theforward direction only or two motion vectors in the backward directiononly may be calculated. In this case, the B-picture refers to twopictures in the forward direction only or two pictures in the backwarddirection.

Also, in the present embodiment, a case has been explained where onepredetermined picture is referred to in coding a P-picture (a pictureP10 is referred to in coding a picture P13, for example) and twopredetermined pictures are referred to in coding a B-picture (picturesP10 and P13 are referred to in coding a picture B11), but theseP-picture and B-picture may be coded by selecting reference pictures forevery macroblock or block from among a plurality of pictures. In such acase, a predictive value of a motion vector can be generated in themanner as shown in FIG. 13.

FIG. 13 is a flowchart showing an operation the motion vector codingunit 117 conducts in deriving a predictive value of a motion vector of acurrent block to code the motion vector, when reference pictures areselected for every block.

First, the motion vector coding unit 117 specifies previously codedthree neighboring blocks of a current block (Step S300).

Then, the motion vector coding unit 117 judges whether each of thespecified neighboring blocks is a neighboring block Ba which has beencoded using motion vectors of other blocks or a neighboring block Bbwhich has been coded without using motion vectors of other blocks (StepS302).

Here, as for the neighboring block Ba, the motion vector coding unit 117obtains information indicating motion vectors used for coding the blockBa and reference pictures for the neighboring block Ba, and treats thosemotion vectors used for coding the block Ba as motion vectors thereof.As for the neighboring block Bb, the motion vector coding unit 117obtains information indicating motion vectors of the neighboring blockBb and reference pictures for the neighboring block Bb (Step S304).

Next, the motion vector coding unit 117 specifies, out of the threeneighboring blocks, a neighboring block which refers to the picture thata current block refers to based on the information obtained in Step S304(Step S306), and determines the number of the specified neighboringblocks (Step S308).

Then, if the number of the neighboring blocks judged in Step S308 is 1,the motion vector coding unit 117 considers the motion vector of theneighboring block which refers to the same picture to be a predictivevalue of the motion vector MV of the current block (Step S310).

If the number of the neighboring blocks judged in Step S308 is not 1,the motion vector coding unit 117 considers the motion vectors of theneighboring blocks which refer to another picture other than the currentblock refers to, out of the three neighboring blocks, to be 0 (StepS312), and considers a median of the motion vectors of the threeneighboring blocks to be a predictive value of the motion vector MV ofthe current block (Step S314).

Using the predictive value derived in Step S310 or Step S314 asmentioned above, the motion vector coding unit 117 calculates adifference between the predictive value and the motion vector MV of thecurrent block, and codes the difference (Step S316).

Also, when a motion vector is coded using a motion vector of a spatiallyadjacent block as a predictive value, an amount of motion vectors of 1macroblock line (a portion of 1 macroblock high and a screen wide) needsto be stored in the motion vector storage unit 116 for coding the motionvector, if the motion vectors which have been actually used for motioncompensation in skip mode or direct mode are stored in the motion vectorstorage unit 116. This applies to the case where the motion vectorswhich have been actually used for motion compensation in skip mode ordirect mode are stored in the motion vector storage unit 116. That iswhy when the neighboring blocks explained in connection with FIGS. 3A-3Dand FIG. 4 of the present embodiment are used, there are past 1macroblock slices of blocks which are referred to as neighboring blocksfor coding the motion vector, with the current macroblock as a startingpoint.

Second Embodiment

A moving picture decoding apparatus 700 in the second embodiment of thepresent invention will be explained with reference to the figures.

FIG. 14 is a block diagram showing the structure of the moving picturedecoding apparatus 700 in the second embodiment of the presentinvention.

The moving picture decoding apparatus 700 as shown in FIG. 14 decodesmoving pictures coded by the moving picture coding apparatus 100 in thefirst embodiment, and includes a bit stream analysis unit 701, aprediction error decoding unit 702, a mode decoding unit 703, a motioncompensation decoding unit 705, a motion vector storage unit 706, aframe memory 707, an addition unit 708, switches 709 and 710, and amotion vector decoding unit 711.

The bit stream analysis unit 701 extracts various data from the inputtedbit stream. Here, various data includes information on coding mode,information on motion vectors, and so on. The extracted coding modeinformation is outputted to the mode decoding unit 703. The extractedmotion vector information is outputted to the motion vector decodingunit 711. Further, the extracted coded prediction error data isoutputted to the prediction error decoding unit 702.

The prediction error decoding unit 702 decodes the inputted codedprediction error data to generate a prediction error image. Thegenerated prediction error image is outputted to the switch 709. Whenthe switch 709 is connected to the terminal “b”, the prediction errorimage is outputted to the addition unit 708.

The mode decoding unit 703 controls the switch 709 and the switch 710with reference to the coding mode information extracted from the bitstream. If the coding mode is intra picture coding, the mode decodingunit 703 controls the switches 709 and 710 to connect to the terminal“a” and the terminal “c”, respectively, and if the coding mode is interpicture coding, it controls the switches 709 and 710 to connect to theterminal “b” and the terminal “d”, respectively. The mode decoding unit703 further outputs the coding mode information to the motion vectordecoding unit 711.

The motion vector decoding unit 711 decodes the motion vectorinformation outputted from the bit stream analysis unit 701.

To be more specific, when the coding mode information indicates interpicture prediction coding using motion vectors, the motion vectordecoding unit 711 derives a predictive value for a current block to bedecoded using the motion vectors of previously decoded neighboringblocks, in the same manner as described in connection with FIGS. 3A-3Dand FIG. 4. For example, as shown in FIGS. 3A-3D, the motion vectordecoding unit 711 derives a predictive value for a current block A fromthe motion vector MVb of the neighboring block B, the motion vector MVcof the neighboring block C and the motion vector MVd of the neighboringblock D. Here, the predictive value is calculated based on a mediancalculated from each of the horizontal components and verticalcomponents of the three previously decoded motion vectors MVb, MVc andMVd. Then, the motion vector decoding unit 711 adds the predictive valueto the difference that is the motion vector information outputted fromthe bit stream analysis unit 701 so as to determine the motion vector MVof the current block A. When the coding mode information is any of theabove-mentioned skip mode, temporal direct mode, and spatial directmode, the motion vector decoding unit 711 determines the motion vectorusing only the motion vectors of the previously decoded neighboringblocks.

FIG. 15 is a flowchart showing the general operation of the motionvector decoding unit 711 in the present embodiment.

First, the motion vector decoding unit 711 specifies previously decodedthree neighboring blocks of a current block to be decoded (Step S200).

Then, the motion vector decoding unit 711 judges whether each of thespecified neighboring blocks is a neighboring block which has been codedusing motion vectors of other blocks or a neighboring block Bb which hasbeen coded without using motion vectors of other blocks (Step S202).

As a result, the motion vector decoding unit 711 determines whether ornot a neighboring block Ba is included in the specified threeneighboring blocks (Step S204).

When it is judged in Step S204 that a neighboring block Ba is included(Y in Step S204), the motion vector decoding unit 711 derives apredictive value from the motion vectors of the three neighboring blocksby treating a motion vector calculated from motion vectors of otherblocks for decoding the neighboring block Ba as a motion vector of theneighboring block Ba, as mentioned above (Step S206).

On the other hand, when it is judged in Step S206 that a neighboringblock Ba is not included (N in Step S204), the motion vector decodingunit 711 derives a predictive value from the motion vectors obtainedrespectively based on the estimation results of the three neighboringblocks Bb (Step S208).

Then, the motion vector decoding unit 711 adds the predictive valuederived in Step S206 or S208 to the difference that is the motion vectorinformation outputted from the bit stream analysis unit 701, so as todecode the coded motion vector of the current block (Step S210). Themotion vector decoding unit 711 also outputs the decoded motion vectorto the motion compensation decoding unit 705.

The motion vector storage unit 706 stores the motion vector decoded inthe motion vector decoding unit 711 and the coding mode obtained in themode decoding unit 703.

The motion compensation decoding unit 705 obtains a motion compensationimage of every macroblock from the frame memory 707 based on the motionvector decoded in the motion vector decoding unit 711.

The addition unit 708 adds the inputted prediction error image and themotion compensation image to generate the decoded image, and outputs thegenerated decoded image to the frame memory 707.

The frame memory 707 stores the decoded image generated by the additionunit 708 on every picture basis.

The operation of this moving picture decoding apparatus 700,particularly the general operation thereof, will be explained first.

FIGS. 16A and 16B are illustrations for explaining input to and outputfrom the moving picture decoding apparatus 700.

As shown in FIG. 16A, the moving picture decoding apparatus 700 obtainsthe bit stream outputted from the moving picture coding apparatus 100 inthe first embodiment in output order, and decodes the pictures includedin the bit stream in sequence. Then, as shown in FIG. 16B, the movingpicture decoding apparatus 700 reorders the decoded pictures in displayorder for output.

The decoding processing performed by the above moving picture decodingapparatus 700 will be explained below by taking decoding of the pictureP13 and the picture B11 as shown in FIGS. 16A and 16B as a specificexample.

(Decoding of Picture P13)

First, the bit stream analysis unit 701 of the moving picture decodingapparatus 700 obtains the bit stream regarding the picture P13, andextracts the mode selection information and the motion vectorinformation and the coded prediction error data from the bit stream.

The mode decoding unit 703 controls the switches 709 and 710 withreference to the mode selection information extracted from the bitstream of the picture P13.

A case where the mode selection information indicates inter pictureprediction coding will be explained below.

The motion vector decoding unit 711 performs the above decodingprocessing on the motion vector information extracted from the bitstream of the picture P13 on a block-by-block basis based on the modeselection information indicating inter picture prediction codingoutputted from the mode decoding unit 703.

Here, when decoding the motion vector of the current block in thepicture P13, the motion vector decoding unit 711 specifies previouslydecoded three neighboring blocks of the current block, and judgeswhether each of these neighboring blocks has been coded using motionvectors of other blocks or not. When any of the neighboring blocks is ablock which has been coded using motion vectors of other blocks, namely,in skip mode, the motion vector decoding unit 711 treats a motion vectorcalculated from the motion vectors of the other blocks for decoding theneighboring block as a motion vector of the neighboring block, in thesame manner as the motion vector coding unit 117 in the first embodimentdoes. To be more specific, the motion vector decoding unit 711calculates the median of the motion vectors of the previously decodedthree blocks in the neighborhood of that neighboring block, and treatsit as a motion vector of the neighboring block.

Also, the motion vector storage unit 706 stores the mode selectioninformation outputted from the mode decoding unit 703, and the motionvector decoding unit 711 judges whether or not each of the neighboringblocks is a block which has been coded using motion vectors of otherblocks based on the mode selection information stored in the motionvector storage unit 706. The motion vector storage unit 706 furtherstores the motion vectors of the other blocks used for decoding theneighboring block. To be more specific, the motion vector storage unit706 stores the motion vectors of the three blocks in the neighborhood ofthe neighboring block which has been coded in skip mode. When decodingthe motion vector of the current block, the motion vector decoding unit711 calculates a median from the motion vectors of the above threeblocks stored in the motion vector storage unit 706. Note that themotion vector storage unit 706 may store in advance a motion vector of ablock which has been coded using motion vectors of other blocks, bycalculating a median of the motion vectors for decoding the block. Inthis case, when decoding the motion vector of the current block, themotion vector decoding unit 711 does not need to obtain the motionvector of the neighboring block which has been coded in skip mode, butcan use the motion vector stored in the motion vector storage unit 706directly as a motion vector of the neighboring block.

On the other hand, the coded prediction error data of the currentmacroblock in the picture P13 is decoded in the prediction errordecoding unit 702 and generated as a prediction error image, and theswitches 709 and 710 are connected to the addition unit 708. Therefore,the motion compensation image generated based on the motion vectordecoded in the motion vector decoding unit 711 is added to theprediction error image and outputted to the frame memory 707.

Also, when decoding a motion vector of a P-picture, the motion vectordecoding unit 711 stores its motion vector and a coding mode obtainedfrom the mode decoding unit 703 in the motion vector storage unit 706for decoding the following pictures and blocks.

The remaining macroblocks in the picture P13 are decoded in sequence.After decoding of all of the macroblocks in the picture P13 iscompleted, decoding of the picture B11 follows.

(Decoding of Picture B11)

First, the bit stream analysis unit 701 of the moving picture decodingapparatus 700 obtains the bit stream of the picture B11, and extractsthe mode selection information and the motion vector information and thecoded prediction error data from the bit stream.

The mode decoding unit 703 controls the switches 709 and 710 withreference to the mode selection information extracted from the bitstream of the picture B11.

A case where the mode selection information indicates inter pictureprediction coding will be explained below.

The motion vector decoding unit 711 performs the above decodingprocessing on the motion vector information extracted from the bitstream of the picture B11 on a block-by-block basis based on the modeselection information indicating inter picture prediction codingoutputted from the mode decoding unit 703.

When decoding a motion vector of a current block in the picture B11, themotion vector decoding unit 711 specifies previously decoded threeneighboring blocks of the current block, and judges whether or not eachof these neighboring blocks has been coded using motion vectors of otherblocks. When any of the neighboring blocks is a block which has beencoded using motion vectors of other blocks, namely, in temporal orspatial direct mode, the motion vector decoding unit 711 treats a motionvector obtained using the motion vectors of the other blocks fordecoding the neighboring block as a motion vector thereof, in the samemanner as the motion vector coding unit 117 in the first embodimentdoes.

More specifically, when the neighboring block has been coded in temporaldirect mode, the motion vector decoding unit 711 reads out from themotion vector storage unit 706 a motion vector of a block, which isco-located with a neighboring block which has been coded in direct mode,in a just previously decoded reference picture (picture P13). Forexample, as shown in FIG. 11, if the neighboring block C has been codedin temporal direct mode, the motion vector decoding unit 711 reads outthe decoded motion vector of the block X in the picture P13 from themotion vector storage unit 706. Then, the motion vector decoding unit711 calculates a forward motion vector MVFc and a backward motion vectorMVBc used for coding the neighboring block C using Equation 1 andEquation 2, and uses these motion vectors MVFc and MVBc as motionvectors of the neighboring block C.

In the above case, the motion vector decoding unit 711 reads out fromthe motion vector storage unit 706 the motion vector MVp of the block Xin the picture P13 which is co-located with the neighboring block Cwhich has been coded in direct mode. However, as for a block which hasbeen coded using motion vectors of other blocks, the motion vectorstorage unit 706 may store the motion vector of the block calculatedfrom the motion vectors of the other blocks for decoding the block. Inthis case, the motion vector storage unit 706 stores the motion vectorsMVFc and MVBc in advance. Therefore, when decoding the motion vector ofthe current block A, the motion vector decoding unit 711 does not needto calculate the motion vectors MVFc and MVBc for the neighboring blockC by reading out the motion vector MVp of the block X and using Equation1 and Equation 2, but can use the motion vectors MVFc and MVBc stored inthe motion vector storage unit 706 directly as motion vectors of theneighboring block C.

On the other hand, when a neighboring block has been coded in spatialdirect mode, the motion vector decoding unit 711 treats motion vectorscalculated using motion vectors of other blocks in the neighborhood ofthe neighboring block as motion vectors thereof. For example, in thesituation as shown in FIG. 12, the motion vector decoding unit 711calculates medians from the motion vectors of the previously decodedthree blocks E, F and G in the neighborhood of the neighboring block Cwhich has been coded in spatial direct mode, and treats the forwardmotion vector MVFc and the backward motion vector MVBc indicated by themedians as motion vectors of the neighboring block C.

Also, the motion vector storage unit 706 stores motion vectors used fordecoding a block which has been coded without using motion vectors ofother blocks. To be more specific, in the situation as shown in FIG. 12,the motion vector storage unit 706 stores the motion vectors of thethree blocks E, F and G in the neighborhood of the neighboring block Cwhich has been coded in spatial direct mode. Therefore, when decodingthe motion vector of the current block A, the motion vector decodingunit 711 calculates the motion vectors MVFc and MVBc for the neighboringblock from the motion vectors of the above three blocks E, F and Gstored in the motion vector storage unit 706. Note that the motionvector storage unit 706 may store in advance motion vectors obtained bycalculating medians for decoding a block which has been coded usingmotion vectors of other blocks. In this case, in the situation as shownin FIG. 12, the motion vector storage unit 706 stores the motion vectorsMVFc and MVBc in advance. Therefore, when decoding the motion vectors ofthe current block A, the motion vector decoding unit 711 does not needto calculate the motion vectors of the neighboring block C which hasbeen coded in spatial direct mode, but can use the motion vectors MVFcand MVBc stored in the motion vector storage unit 706 directly as motionvectors of the neighboring block C.

Here, when motion vectors of a current block to be decoded are decoded,if previously decoded neighboring block of the current block has beenprocessed in intra picture coding, not in inter picture coding asmentioned above, the moving picture decoding apparatus 700 performsexceptional processing.

For example, when one of three neighboring blocks has been intra picturecoded, the motion vector decoding unit 711 of the moving picturedecoding apparatus 700 performs processing considering the motionvectors of the neighboring block to be 0. When two neighboring blockshave been intra picture coded, the motion vector decoding unit 711 usesthe motion vectors of the remaining one neighboring block as predictivevalues of the motion vectors of the current block. Further, when all thethree neighboring blocks have been intra picture coded, the motionvector decoding unit 711 decodes the motion vectors of the current blockconsidering predictive values thereof to be 0.

On the other hand, the coded prediction error data for the currentmacroblock in the picture B11 has been decoded in the prediction errordecoding unit 702 and generated as a prediction error image, and theswitches 709 and 710 are connected to the addition unit 708. Therefore,the motion compensation image generated based on the motion vectordecoded by the motion vector decoding unit 711 is added to theprediction error image and outputted to the frame memory 707.

Decoding processing of the remaining macroblocks in the picture B11 isperformed in the same manner. After the processing is completed for allthe macroblocks in the picture B11, the decoding processing of thepicture B12 follows.

As described above, according to the motion vector decoding method ofthe present invention, a predictive value is derived from motion vectorsof previously decoded neighboring blocks, and a motion vector of eachcurrent block is decoded using the predictive value and the difference.If any of the neighboring blocks has been coded using motion vectors ofother blocks, for example, in skip mode or direct mode, a predictivevalue is derived using, as a motion vector of the neighboring block, amotion vector calculated from the motion vectors of the other blocks fordecoding that neighboring block.

Accordingly, motion vectors which have been coded in the manner as shownin the first embodiment can be decoded properly.

Note that, in the present embodiment, a case has been explained where amedian calculated from motion vectors of previously decoded threeneighboring blocks is used as a predictive value for decoding a motionvector, but any other number of neighboring blocks than three may beapplied, and the predictive value may be determined by any other method.For example, a motion vector of an immediately left block may be used asa predictive value, or an average, instead of a median, may be used.

Also, in the present embodiment, locations of neighboring blocks fordecoding a motion vector has been explained using FIG. 3 and FIG. 4, butany other locations may be applied.

Also, in the present embodiment, a method for coding a current blockusing motion vectors of other blocks has been explained by taking skipmode and temporal and spatial direct modes as examples, but any othermode may be used.

Also, in the present embodiment, a case has been explained where amotion vector is decoded by adding a predictive value obtained frommotion vectors of neighboring blocks and a difference as indicated in abit stream, but any other method than addition may be used to decode themotion vector.

Also, in the present embodiment, a case has been explained where when aneighboring block has been coded in spatial direct mode, a median ofmotion vectors of previously coded three blocks in the neighborhood ofthe neighboring block is calculated and is treated as a motion vector ofthe neighboring block, but any other number of blocks than three may beused, and any other method may be used to determine the motion vector.For example, a motion vector of an immediately left block may be used asa motion vector of the neighboring block, or an average, instead of amedian, may be used.

Also, in the present embodiment, when there exists a neighboring blockwhich has been coded in spatial direct mode, two motion vectors of theblock in the forward and backward directions are calculated, but twomotion vectors in the forward direction only or two motion vectors inthe backward direction only may be calculated. In this case, a currentB-picture to be decoded refers to two pictures in the forward directiononly or two pictures in the backward direction only.

Also, in the present embodiment, a case has been explained where onepredetermined picture is referred to in decoding a P-picture (thepicture P10 is referred to in decoding the picture P13, for example) andtwo predetermined pictures are referred to in decoding a B-picture (thepictures P10 and P13 are referred to in decoding the picture B11), butthese P-picture and B-picture may be decoded by selecting referencepictures from among a plurality of pictures on every macroblock or blockbasis. In such a case, a predictive value of a motion vector can begenerated in the manner as shown in FIG. 17.

FIG. 17 is a flowchart showing an operation of the motion vectordecoding unit 711 for deriving a predictive value of a motion vector ofa current block to be decoded and decoding the motion vector using thepredictive value when a reference picture is selected on ablock-by-block basis.

First, the motion vector decoding unit 711 specifies previously decodedthree neighboring blocks of the current block (Step S400).

Then, the motion vector decoding unit 711 judges whether each of thespecified neighboring blocks is a neighboring block Ba which has beencoded using motion vectors of other blocks, or a neighboring block Bbwhich has been coded without using motion vectors of other blocks (StepS402).

Here, as for the neighboring block Ba, the motion vector decoding unit711 obtains information indicating a motion vector used for decoding theneighboring block Ba and which reference picture it refers to, andtreats the motion vector used for the decoding as a motion vector of theneighboring block Ba. As for the neighboring block Bb, the motion vectordecoding unit 711 obtains information indicating the motion vector ofthe neighboring block Bb and which reference picture it refers to (StepS404).

Next, the motion vector decoding unit 711 specifies the neighboringblock which refers to the picture that the current block refers to, outof the three neighboring blocks, based on the information obtained inStep S404 (Step S406), and determines the number of the specifiedneighboring blocks (Step S408).

If the number of the neighboring blocks determined in Step S408 is 1,the motion vector decoding unit 711 considers the motion vector of thatone neighboring block which refers to the same picture to be apredictive value of the motion vector of the current block (Step S410).

If the number of the neighboring blocks determined in Step S408 isanother number than one, the motion vector decoding unit 711 considersthe motion vector of the neighboring block, out of the three neighboringblocks, which refers to another picture other than the current blockrefers to be 0 (Step S412), and considers the median of the motionvectors of the three neighboring blocks as a predictive value of themotion vector of the current block (Step S414).

As described above, the coded motion vector of the current block isdecoded by adding the difference to the predictive value derived in StepS410 or Step S414.

Also, when a motion vector is decoded using a motion vector of aspatially adjacent block as a predictive value, an amount of motionvectors of 1 macroblock line (a portion of 1 macroblock high and ascreen wide) needs to be stored in the motion vector storage unit 706for decoding the motion vector, if the motion vectors which have beenactually used for motion compensation in skip mode or direct mode arestored in the motion vector storage unit 706. This applies to the casewhere the motion vectors which have been actually used for motioncompensation in skip mode or direct mode are stored in the motion vectorstorage unit 706. That is why when the neighboring blocks explained inconnection with FIGS. 3A-3D and FIG. 4 of the present embodiment areused, there are past 1 macroblock slice of blocks which are referred toas neighboring blocks for decoding the motion vector, with the currentmacroblock as a starting point.

Third Embodiment

In addition, if a program for realizing the motion vector coding methodor the motion vector decoding method as shown in each of theabove-mentioned embodiments is recorded on a storage medium such as aflexible disk, it becomes possible to perform the processing as shown ineach of the above embodiments easily in an independent computer system.

FIGS. 18A-18C are illustrations of a storage medium that stores aprogram for realizing the motion vector coding method and the motionvector decoding method executed by the moving picture coding apparatus100 in the first embodiment and the moving picture decoding apparatus200 in the second embodiment by a computer system.

FIG. 18B shows the front view and the cross-sectional view of theappearance of a flexible disk FD, and a disk FD1, and FIG. 18A shows anexample of a physical format of the disk FD1 as a recording mediumitself.

The disk FD1 is contained in a case F, a plurality of tracks Tr areformed concentrically on the surface of the disk FD1 in the radiusdirection from the periphery, and each track is divided into 16 sectorsSe in the angular direction. Therefore, in the flexible disk storing theabove-mentioned program, the motion vector coding method and the motionvector decoding method as the above program are recorded in an areaallocated for it on the disk FD1.

FIG. 18C shows the structure for recording and reproducing the programon and from the flexible disk FD.

For recording the program on the flexible disk FD, the computer systemCs writes the motion vector coding method or the motion vector decodingmethod as the program on the flexible disk FD via a flexible disk driveFDD. For constructing the above motion vector coding method and themotion vector decoding method in the computer system Cs by the programrecorded on the flexible disk FD, the program is read out from theflexible disk FD via the flexible disk drive FDD and transferred to thecomputer system Cs.

Note that the above explanation is made on the assumption that arecording medium is a flexible disk FD, but the same processing can alsobe performed using an optical disk. In addition, the recording medium isnot limited to these, but any other mediums such as an IC card and a ROMcassette can be used in the same manner if a program can be recorded onthem.

Fourth Embodiment

Further, the applications of the motion vector coding method and themotion vector decoding method as shown in the above embodiments and asystem using them will be explained here.

FIG. 19 is a block diagram showing the overall configuration of acontent providing system ex100 for realizing content distributionservice. The area for providing communication service is divided intocells of desired size, and base stations ex107˜ex110 which are fixedwireless stations are placed in respective cells.

In this content providing system ex100, various devices such as acomputer ex111, a PDA (personal digital assistant) ex112, a cameraex113, a mobile phone ex114 and a camera-equipped mobile phone ex115 areconnected to the Internet ex101, via an Internet service provider ex102,a telephone network ex104 and base stations ex107˜ex110, for example.

However, the content providing system ex100 is not limited to thecombination as shown in FIG. 19, and may be connected to a combinationof any of them. Also, each device may be connected directly to thetelephone network ex104, not through the base stations ex107˜ex110 whichare the fixed wireless stations.

The camera ex113 is a device such as a digital video camera capable ofshooting moving pictures. The mobile phone may be any of a mobile phoneof a PDC (Personal Digital Communications) system, a CDMA (Code DivisionMultiple Access) system, a W-CDMA (Wideband-Code Division MultipleAccess) system or a GSM (Global System for Mobile Communications)system, a PHS (Personal Handyphone System) and the like.

Also, a streaming server ex103 is connected to the camera ex113 via thebase station ex109 and the telephone network ex104, which enables livedistribution or the like using the camera ex113 based on the coded datatransmitted from the user. Either the camera ex113 or the server fortransmitting the data may code the data shot by the camera. Also, themoving picture data shot by a camera ex116 may be transmitted to thestreaming server ex103 via the computer ex111. The camera ex116 is adevice such as a digital camera capable of shooting still and movingpictures. In this case, either the camera ex116 or the computer ex111may code the moving picture data. An LSI ex117 included in the computerex111 or the camera ex116 performs coding processing. Note that softwarefor coding and decoding pictures may be integrated into any type of astorage medium (such as a CD-ROM, a flexible disk and a hard disk) thatis a recording medium which can be read by the computer ex111 or thelike. Furthermore, the camera-equipped mobile phone ex115 may transmitthe moving picture data. This moving picture data is the data coded bythe LSI included in the mobile phone ex115.

In this content providing system ex100, contents (such as a music livevideo) shot by users using the camera ex113, the camera ex116 or thelike are coded in the same manner as the above embodiments andtransmitted to the streaming server ex103, while the streaming serverex103 makes stream distribution of the above content data to the clientsat their request. The clients include the computer ex111, the PDA ex112,the camera ex113, the mobile phone ex114 and so on capable of decodingthe above-mentioned coded data. The content providing system ex100 is asystem in which the clients can thus receive and reproduce the codeddata, and further can receive, decode and reproduce the data in realtime so as to realize personal broadcasting.

When each device in this system performs coding or decoding, the movingpicture coding apparatus or the moving picture decoding apparatus asshown in each of the above-mentioned embodiments may be used.

A mobile phone will be explained as an example thereof.

FIG. 20 is a diagram showing a mobile phone ex115 which uses the motionvector coding method and the motion vector decoding method as explainedin the above embodiments. The mobile phone ex115 has an antenna ex201for sending and receiving radio waves between the base station ex110, acamera unit ex203 such as a CCD camera capable of shooting video andstill pictures, a display unit ex202 such as a liquid crystal displayfor displaying the data obtained by decoding video shot by the cameraunit ex203, video received by the antenna ex201, or the like, a mainbody including a set of operation keys ex204, a voice output unit ex208such as a speaker for outputting voices, a voice input unit ex205 suchas a microphone for inputting voices, a storage medium ex207 for storingcoded or decoded data, such as data of moving or still pictures shot bythe camera, and data of text, moving pictures or still pictures ofreceived e-mails, and a slot unit ex206 for attaching the storage mediumex207 into the mobile phone ex115. The storage medium ex207 includes aflash memory element, a kind of EEPROM (Electrically Erasable andProgrammable Read Only Memory) that is an electrically erasable andrewritable nonvolatile memory, in a plastic case such as an SD card.

Further, the mobile phone ex115 will be explained with reference to FIG.21. In the mobile phone ex115, a main control unit ex311 for overallcontrolling each unit of the main body including the display unit ex202and the operation keys ex204 is connected to a power supply circuit unitex310, an operation input control unit ex304, a picture coding unitex312, a camera interface unit ex303, an LCD (Liquid Crystal Display)control unit ex302, a picture decoding unit ex309, amultiplex/demultiplex unit ex308, a record/reproduce unit ex307, a modemcircuit unit ex306 and a voice processing unit ex305 to each other via asynchronous bus ex313.

When a call-end key or a power key is turned ON by a user's operation,the power supply circuit unit ex310 supplies respective units with powerfrom a battery pack so as to activate the camera-equipped digital mobilephone ex115 for a ready state.

In the mobile phone ex115, under the control of the main control unitex311 including a CPU, ROM, RAM and the like, the voice processing unitex305 converts the voice signals received by the voice input unit ex205in conversation mode into digital voice data, the modem circuit unitex306 performs spread spectrum processing of the digital voice data, andthe send/receive circuit unit ex301 performs digital-to-analogconversion and frequency transformation of the data, so as to transmitthe result via the antenna ex201. Also, in the mobile phone ex115, thedata received by the antenna ex201 in conversation mode is amplified andperformed of frequency transformation and analog-to-digital conversion,the modem circuit unit ex306 performs inverse spread spectrum processingof the data, and the voice processing unit ex305 converts it into analogvoice data, so as to output the result via the voice output unit ex208.

Furthermore, when transmitting an e-mail in data communication mode, thetext data of the e-mail inputted by operating the operation keys ex204on the main body is sent out to the main control unit ex311 via theoperation input control unit ex304. In the main control unit ex311,after the modem circuit unit ex306 performs spread spectrum processingof the text data and the send/receive circuit unit ex301 performsdigital-to-analog conversion and frequency transformation of it, theresult is transmitted to the base station ex110 via the antenna ex201.

When picture data is transmitted in data communication mode, the picturedata shot by the camera unit ex203 is provided to the picture codingunit ex312 via the camera interface unit ex303. When the picture data isnot transmitted, the picture data shot by the camera unit ex203 can alsobe displayed directly on the display unit 202 via the camera interfaceunit ex303 and the LCD control unit ex302.

The picture coding unit ex312, including the picture coding apparatusexplained in the present invention, compress and codes the picture dataprovided from the camera unit ex203 by the coding method used for thepicture coding apparatus as shown in the above-mentioned embodiments soas to transform it into coded picture data, and sends it out to themultiplex/demultiplex unit ex308. At this time, the mobile phone ex115sends out the voices received by the voice input unit ex205 duringpicture pickup by the camera unit ex203 to the multiplex/demultiplexunit ex308 as digital voice data via the voice processing unit ex305.

The multiplex/demultiplex unit ex308 multiplexes the coded picture dataprovided from the picture coding unit ex312 and the voice data providedfrom the voice processing unit ex305 by a predetermined method, themodem circuit unit ex306 performs spread spectrum processing of theresulting multiplexed data, and the send/receive circuit unit ex301performs digital-to-analog conversion and frequency transformation onthe result for transmitting via the antenna ex201.

As for receiving data of a moving picture file which is linked to aWebsite or the like in data communication mode, the modem circuit unitex306 performs inverse spread spectrum processing of the data receivedfrom the base station ex110 via the antenna ex201, and sends out theresulting multiplexed data to the multiplex/demultiplex unit ex308.

In order to decode the multiplexed data received via the antenna ex201,the multiplex/demultiplex unit ex308 demultiplexes the multiplexed datainto a coded bit stream of picture data and a coded bit stream of voicedata, and provides the coded picture data to the picture decoding unitex309 and the voice data to the voice processing unit ex305 respectivelyvia the synchronous bus ex313.

Next, the picture decoding unit ex309, including the picture decodingapparatus explained in the present invention, decodes the coded bitstream of the picture data by the decoding method paired with the codingmethod as shown in the above-mentioned embodiments, so as to generatereproduced moving picture data, and provides this data to the displayunit ex202 via the LCD control unit ex302, and thus moving picture dataincluded in a moving picture file linked to a Website, for instance, isdisplayed. At the same time, the voice processing unit ex305 convertsthe voice data into analog voice data, and provides this data to thevoice output unit ex208, and thus voice data included in a movingpicture file linked to a Website, for instance, is reproduced.

The present invention is not limited to the above-mentioned system.Ground-based or satellite digital broadcasting has been in the newslately, and at least either the picture coding apparatus or the picturedecoding apparatus in the above-mentioned embodiments can beincorporated into such a digital broadcasting system as shown in FIG.22. More specifically, a coded bit stream of video information istransmitted from a broadcast station ex409 to or communicated with abroadcast satellite ex410 via radio waves. Upon receipt of it, thebroadcast satellite ex410 transmits radio waves for broadcasting, a homeantenna ex406 with a satellite broadcast reception function receives theradio waves, and an apparatus such as a television (receiver) ex401 or aset top box (STB) ex407 decodes the coded bit stream for reproduction.The picture decoding apparatus as shown in the above-mentionedembodiments can be implemented in the reproduction device ex403 forreading a coded bit stream recorded on a storage medium ex402 such as aCD and DVD that is a recording medium and decoding it. In this case, thereproduced video signals are displayed on a monitor ex404. It is alsoconceived to implement the picture decoding apparatus in the set top boxex407 connected to a cable ex405 for a cable television or the antennaex406 for satellite and/or ground-based broadcasting so as to reproducethem on a monitor ex408 of the television. The picture decodingapparatus may be incorporated into the television, not in the set topbox. Or, a car ex412 having an antenna ex411 can receive signals fromthe satellite ex410, the base station ex107 or the like for reproducingmoving pictures on a display apparatus such as a car navigation deviceex413 or the like in the car ex412.

Furthermore, the picture coding apparatus as shown in theabove-mentioned embodiments can code picture signals for recording themon a recording medium. As a concrete example, there is a recorder ex420such as a DVD recorder for recording picture signals on a DVD disk ex421and a disk recorder for recording them on a hard disk. They can also berecorded on an SD card ex422. If the recorder ex420 includes the picturedecoding apparatus as shown in the above-mentioned embodiments, thepicture signals recorded on the DVD disk ex421 or the SD card ex422 canbe reproduced for display on the monitor ex408.

Note that as the structure of the car navigation device ex413, thestructure without the camera unit ex203, the camera interface unit ex303and the picture coding unit ex312, out of the units as shown in FIG. 21,is conceivable. The same applies to the computer ex111, the television(receiver) ex401 and others.

In addition, three types of implementations can be conceived for aterminal such as the above-mentioned mobile phone ex114; asending/receiving terminal equipped with both an encoder and a decoder,a sending terminal equipped with an encoder only, and a receivingterminal equipped with a decoder only.

As described above, it is possible to use the motion vector codingmethod or the motion vector decoding method as shown in the aboveembodiments in any of above-mentioned devices and systems, and thus theeffects explained in the above embodiments can be obtained.

The motion vector coding method and the motion vector decoding methodaccording to the present invention are suitable for use in a movingpicture coding apparatus for coding moving pictures, a moving picturedecoding apparatus for decoding coded moving pictures, and a systemincluding these apparatuses, such as a content providing system forproviding contents like digital works, for example, and a digitalbroadcasting system.

1. A motion vector coding method for coding a motion vector of a currentblock in a moving picture, said method comprising: a neighboring blockspecification step of specifying three neighboring blocks, the threeneighboring blocks being located in a neighborhood of the current block;a first judgment step of judging whether or not each of the threeneighboring blocks has been coded using a motion vector of anotherblock; a second judgment step of judging whether or not a referencepicture referred to in the coding of the current block is the same as areference picture referred to in the coding of each of the threeneighboring blocks; a different motion vector determining step ofdetermining a different motion vector of each of the plurality ofneighboring blocks based on a result of the first judgment step; aprediction step of deriving a predictive motion vector of the currentblock using different motion vectors of the plural neighboring blocksbased on a result of the second judgment step; a motion vector codingstep of coding a difference value between the motion vector of thecurrent block and the predictive motion vector, wherein, in thedifferent motion vector determining step of determining a differentmotion vector of each of the plurality of neighboring blocks, (1) amotion vector, which is calculated from the motion vector of the otherblock and which is used in performing a coding process on theneighboring block, is determined as a different motion vector of theneighboring block when it is judged in the first judgment step that theneighboring block has been coded using the motion vector of the otherblock, and (2) a motion vector, which is detected for the neighboringblock and which is used in performing a coding process on theneighboring block, is determined as a different motion vector of theneighboring block when it is judged in the first judgment step that theneighboring block has not been coded using the motion vector of theother block, wherein, in the prediction step of deriving a predictivemotion vector of the current block, (1) when it is judged in the secondjudgment step that three neighboring blocks refer to the same referencepicture as the current block, the predictive motion vector of thecurrent block is set to a median of three motion vectors of the threeneighboring blocks, and (2) when it is judged in the second judgmentstep that only one of the three neighboring blocks refer to the samereference picture as the current block, the predictive motion vector ofthe current block is set to be a motion vector of the only oneneighboring block having the same reference picture as the currentblock.
 2. A motion vector coding apparatus for coding a motion vector ofa current block in a moving picture, said apparatus comprising: aneighboring block specification unit operable to specify threeneighboring blocks, the three neighboring blocks being located in aneighborhood of the current block; a first judgment unit operable tojudge whether or not each of the three neighboring blocks has been codedusing a motion vector of another block; a second judgment unit operableto judge whether or not a reference picture referred to in the coding ofthe current block is the same as a reference picture referred to in thecoding of each of the three neighboring blocks; a different motionvector determining unit operable to determine a different motion vectorof each of the plurality of neighboring blocks based on a result of thefirst judgment unit; a prediction unit operable to derive a predictivemotion vector of the current block using different motion vectors of theplural neighboring blocks based on a result of the second judgment unit;a coding unit operable to code a difference value between the motionvector of the current block and the predictive motion vector, wherein,the different motion vector determining unit is further operable to: (1)determine a motion vector, which is calculated from the motion vector ofthe other block and which is used in performing a coding process on theneighboring block, as a different motion vector of the neighboring blockwhen it is judged by the first judgment unit that the neighboring blockhas been coded using the motion vector of the other block, and (2)determine a motion vector, which is detected for the neighboring blockand which is used in performing a coding process on the neighboringblock, as a different motion vector of the neighboring block when it isjudged by the first judgment unit that the neighboring block has notbeen coded using the motion vector of the other block, wherein, theprediction unit is further operable to: (1) set the predictive motionvector of the current block to a median of three motion vectors of thethree neighboring blocks when it is judged by the second judgment unitthat the three neighboring blocks refer to the same reference picture asthe current block, and (2) set the predictive motion vector of thecurrent block to a motion vector of one neighboring block having thesame reference picture as the current block when it is judged by thesecond judgment unit that only one of the three neighboring blocksrefers to the same reference picture as the current block.